package com.cc.model.convert

import com.cc.model.ScriptRecord
import com.cc.model.dto.ScriptRecordDto
import org.mapstruct.*

@Mapper(unmappedTargetPolicy = ReportingPolicy.IGNORE, componentModel = MappingConstants.ComponentModel.SPRING)
abstract class ScriptRecordConvert {

    abstract fun toEntity(scriptRecordDto: ScriptRecordDto): ScriptRecord

    abstract fun toDto(scriptRecord: ScriptRecord): ScriptRecordDto

    @BeanMapping(nullValuePropertyMappingStrategy = NullValuePropertyMappingStrategy.IGNORE)
    abstract fun partialUpdate(scriptRecordDto: ScriptRecordDto, @MappingTarget scriptRecord: ScriptRecord): ScriptRecord
}